/*
 * Copyright © 2023 广州宏天软件股份有限公司 hotent
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hotent.project.app.controller;

import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.manager.CommonManager;
import com.hotent.base.model.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author: 黎扬贵
 * @description: 测试demo
 * @date: 2023/6/14 下午3:46
 * @version: 1.0
 */
@RestController
@RequestMapping("/demo/v1")
@Api(tags = "demo")
@ApiGroup(group = {"defaultApi"})
public class DemoController {

    @Resource
    CommonManager commonManager;

    @RequestMapping(value = "test", method = RequestMethod.GET, produces = {"application/json; charset=utf-8"})
    @ApiOperation(value = "测试", httpMethod = "GET", notes = "测试")
    public CommonResult<?> test(@ApiParam(name = "name", value = "名称") @RequestParam(name = "name") String name) throws Exception {
        List<Map<String, Object>> query = commonManager.query("select * from bpmx_re_decision_req_def");
        return CommonResult.ok().value(query);
    }

}
